import React, { Component } from 'react'

export default    (WrappedComponent,name)=>{

    class NewComponent extends Component {
        constructor(){
            super()
            this.state = {
                data:''
            }
        }
        componentWillMount() {
            let data = localStorage.getItem(name)
            this.setState({data})
            console.log("NEW")
            console.log(this.state)
        }
        render() {
           
            return (
                <WrappedComponent data={this.state.data}/>
            )
        }
    }
    return NewComponent
}
